Carbon


SetThreadReadyGivenTaskRef

Header: Threads.h Carbon status: Supported

Changes the state of a thread from stopped to ready when your application is not the current process.

OSErr SetThreadReadyGivenTaskRef (
    ThreadTaskRef threadTRef, 
    ThreadID threadToSet
);
threadTRef

The thread task reference of the application containing the thread whose state you want to change.

threadToSet

The thread ID of the thread whose state you want to change.

function result

A result code.

DISCUSSION

When you mark a thread as ready to run with this function, the Thread Manager does not put it immediately into the scheduling queue but does so the next time it reschedules threads.

You can use SetThreadStateGivenTaskRef at times when you arenít guaranteed that your application is the current context, such as during execution of an interrupt function. In such cases you must identify the thread task reference (the application context) as well as the thread ID.

You obtain the thread task reference for your application with the GetThreadCurrentTaskRef function.

The SetThreadReadyGivenTaskRef function allows you to do one thing onlyóchange a thread from stopped to ready to execute. You cannot change the state of an executing thread to ready or stopped, nor can you change the state of a ready thread to executing or stopped with this call.

To determine the state of a thread when your application is not the current process, use the GetThreadStateGivenTaskRef function.

AVAILABILITY

Supported in Carbon. Available in CarbonLib 1.0 and later when ThreadsLib 1.0 or later is installed. Exported by CarbonLib 1.0 and later and by ThreadsLib 1.0 and later.


© 2000 Apple Computer, Inc. — (Last Updated 3/8/2000)